package dispatcher.person.gui.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

import dispatcher.person.gui.PersonDispatcherView;

/**
 * This class handles actions done by the clear button on the 
 * PersonDispatcherView
 * @author Caleb
 *
 */
public class ClearPersonCreatorActionListener implements ActionListener {

	private PersonDispatcherView view;
	
	/**
	 * The view that needs to be cleared
	 * @param view The view this action is going to act on
	 */
	public ClearPersonCreatorActionListener(PersonDispatcherView view){
		this.view = view;
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0) {
		if (arg0.getSource() instanceof JButton){
			// Resets all the fields in the person dispatcher view
			view.resetFields();

		}
	}

}
